<?php
include "lib/MyMsServic.php";
include "lib/MySqlHelper.class.php";

$mymssql = new MyMsServic();
$mysql = new MySqlHelper();
$sql="select [SaleLineID],[saleStatue],[Adult],[Child],[beginDate],[lineName] FROM [faxtongxiang].[dbo].[T_saleLine] where beginDate > '2020-12-31 00:00:00' and groupOpType = '散拼'";
$stmt=$mymssql->mGetMsAll($sql);
//print_r($stmt);
$valueStr = '';
   foreach($stmt as $v){
            $valueStr .= "(".$v['0'].",'".$v['1']."','".$v['2']."','".$v['3']."','".$v['4']."','".$v['5']."'),";
       //print_r($valueStr);
    }
   $valueStr = substr($valueStr,0,strlen($valueStr)-1);
  //print_r($valueStr);
    $insertSql = "INSERT into `orders`(saleLineID,saleStatue,adult_num,child_num,start_date,lineName) values".$valueStr;
//    $res = $mysql->execute_dql($insertSql);
    $rs =$mysql->uidRst($insertSql);
if($rs>0  ){
    echo '插入成功';
}else{
    echo '插入失败';
}
